﻿using LeaderCCSLaserUI.Models;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.IO.Pipes;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace LeaderCCSLaserUI.Common.Converters
{
    internal class ResultToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var color = new SolidColorBrush(Colors.Transparent);
            if (value is DispReuslt v1)
            {
                switch (v1)
                {
                    case DispReuslt.Pass:
                        color = new SolidColorBrush(Colors.PaleGreen);
                        break;
                    case DispReuslt.Ng:
                        color = new SolidColorBrush(Colors.LightPink);
                        break;
                    default:
                        break;
                }
            }
            return color;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return Binding.DoNothing;
        }
    }
}
